<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="/WEB-INF/templates/template.xhtml">
	<ui:define name="content">
		<h:form id="CadCliente">

			<p:panel id="Janela" header="Novo Cliente">

				<p:messages id="msgs" />

				<h:panelGrid columns="3">
					<h:outputText for="nome" value="Nome* :"></h:outputText>
					<p:inputText id="nome" value="#{userController.user.nome}"
						required="true" label="Nome">
						<f:validateLength minimum="3" />
					</p:inputText>
					<p:message for="nome" display="icon" />

					<h:outputText for="cpf" value="CPF* :"></h:outputText>
					<p:inputMask mask="999.999.999-99" id="cpf" value="#{userController.user.cpf}"
						required="true" label="CPF">
						<f:validateLength minimum="3" />
					</p:inputMask>
					<p:message for="cpf" display="icon" />

					<h:outputText for="email" value="E-mail* :"></h:outputText>
					<p:inputText id="email" value="#{userController.user.email}"
						required="true" label="E-mail">
						<f:validateLength minimum="5" />
					</p:inputText>
					<p:message for="email" display="icon" />

				</h:panelGrid>

				<!-- Pega o id do Usuário -->
				<h:inputHidden value="#{userController.user.idConta}" /> 
				<p:commandButton id="btn" value="Salvar Dados" update="Janela"
					action="#{userController.cadastrarConta}" ajax="false" />

			</p:panel>


		</h:form>
	</ui:define>
</ui:composition>
</html>